import Vue from 'vue'
import VueRouter from 'vue-router'
//安装插件
Vue.use(VueRouter)
//一级路由
import Home from '@/views/home/home.vue'
import Search from '@/views/search/search.vue'
import Login from '@/views/login/login.vue'
import Register from '@/views/register/register.vue'
//对外暴露VUeRouter类的实例：路由器对象
export default new VueRouter({
    mode: 'history',
    routes: [
        {
            path: '/',
            redirect: '/home'
        },
        {
            path: '/home',
            component: Home
        },
        {
            path: '/search',
            component: Search
        },
        {
            path: '/login',
            component: Login
        },
        {
            path: '/register',
            component: Register
        },
    ]
})
